<? // update - update one col via ajax

// todo: security level for tables

$tbl = $_GET['tbl'];
$idx = $_GET['idx'];
$col = $_GET['col'];
$val = mysql_real_escape_string( $_GET['val'] );

$ct = db_dml( "update $tbl set $col = '$val' where $idx" );

if( $ct )	ajax_exit( 'success', "$ct records updated" );
else		ajax_exit( 'failure', "unable to update $tbl where $idx" );

?>
